package com.cardone.platform.authority.service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;


import lombok.Getter;


import lombok.Setter;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;

import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.context.Attributes;
import com.cardone.context.ContextHolder;
import com.cardone.common.util.EntityUtils;
import com.cardone.platform.authority.dao.NavigationDao;
import com.cardone.platform.authority.dto.NavigationDto;

/**
 * 导航服务
 *
 * @author yaohaitao
 * 
 */
@Getter 
@Setter
@Transactional(readOnly = true)
public class NavigationDefaultService implements NavigationService {
	@Override
	@Transactional
	public <P> P saveByIdOrCode(Class<P> mappedClass, NavigationDto saveNavigation) {
		return ContextHolder.getBean(NavigationDao.class).saveByIdOrCode(mappedClass, saveNavigation);
	}
	
	@Override
	@Transactional
	public NavigationDto saveByIdOrCode(NavigationDto saveNavigation) {
		return ContextHolder.getBean(NavigationDao.class).saveByIdOrCode(NavigationDto.class, saveNavigation);
	}
	
	@Override
	public <P> P findByCodeOrId(Class<P> mappedClass, NavigationDto findNavigation) {
		return ContextHolder.getBean(NavigationDao.class).findByCodeOrId(mappedClass, findNavigation);
	}
	
	@Override
	public Integer readByCodeNqIdForCount(NavigationDto readNavigation) {
		return ContextHolder.getBean(NavigationDao.class).readByCodeNqIdForCount(readNavigation);
	}
	
	@Override
	@Transactional
	public int insertByCode(NavigationDto insertNavigation) {
		return ContextHolder.getBean(NavigationDao.class).insertByCode(insertNavigation);
	}
	
	@Override
	@Transactional
	public int updateByCode(NavigationDto updateNavigation) {
		return ContextHolder.getBean(NavigationDao.class).updateByCode(updateNavigation);
	}

	@Override
	@Transactional
	public int deleteByIds(NavigationDto deleteNavigation) {
		return ContextHolder.getBean(NavigationDao.class).deleteByIds(deleteNavigation);
	}

	@Override
	public <P> P findById(Class<P> mappedClass, NavigationDto findNavigation) {
		return ContextHolder.getBean(NavigationDao.class).findById(mappedClass, findNavigation);
	}

	@Override
	public <P> List<P> findListByLikeCode(Class<P> mappedClass, NavigationDto findListNavigation) {
		return ContextHolder.getBean(NavigationDao.class).findListByLikeCode(mappedClass, findListNavigation);
	}

	@Override
	public <P> List<P> findList(Class<P> mappedClass) {
		return ContextHolder.getBean(NavigationDao.class).findList(mappedClass);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, NavigationDto paginationNavigation) {
		return ContextHolder.getBean(NavigationDao.class).paginationByLikeCode(mappedClass, paginationNavigation);
	}
}